import { createStore } from 'vuex'
const store = createStore({
  state: {
    count: 0
  },
  mutations: {
    changeCount(state, num = 1) {
      state.count += num
    }
  },
  actions: {
    changeCountAsync(state, num) {
      setTimeout(() => {
        state.commit('changeCount', num)
      }, 1000);
    }
  }
})
export default store